package cn.jiyun.user.service;

import cn.jiyun.user.mapper.UserMapper;
import cn.jiyun.user.pojo.Users;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private UserMapper userMapper;


    @Override
    public void saveUser(Users users) {
        userMapper.insertUser(users);
    }

    @Override
    public void updateUser(Users users) {
        userMapper.updateUser(users);
    }

    @Override
    public List<Users> findAll() {
        return userMapper.findAll();
    }

    @Override
    public Users findById(String id) {
        return userMapper.findById(id);
    }

//    @Override
//    public Users findById(String id) {
//     return    userMapper.findById(id);
//    }

    @Override
    public Users login(String username, String password) {
        return userMapper.login(username,password);
    }

    @Override
    public void deleteUser(String id) {
        userMapper.deleteUser(id);
    }
}
